{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Number of SSMs for direct searches"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "import sys\n",
    "\n",
    "src_dir = os.path.abspath('../src')\n",
    "if src_dir not in sys.path:\n",
    "    sys.path.append(src_dir)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "from ann_solo import reader"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>search mode</th>\n",
       "      <th>number of SSMs</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>20 ppm</td>\n",
       "      <td>4147</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>300 Da (cascade, dot)</td>\n",
       "      <td>5167</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>300 Da (cascade, shifted dot)</td>\n",
       "      <td>6011</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>300 Da (no cascade, dot)</td>\n",
       "      <td>3820</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>300 Da (no cascade, shifted dot)</td>\n",
       "      <td>5020</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                        search mode  number of SSMs\n",
       "0                            20 ppm            4147\n",
       "1             300 Da (cascade, dot)            5167\n",
       "2     300 Da (cascade, shifted dot)            6011\n",
       "3          300 Da (no cascade, dot)            3820\n",
       "4  300 Da (no cascade, shifted dot)            5020"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ssms_dir = '../../data/processed/iprg2012/brute_force'\n",
    "\n",
    "ssms_std = reader.read_mztab_ssms(os.path.join(ssms_dir, 'bf_std.mztab'))\n",
    "ssms_oms = reader.read_mztab_ssms(os.path.join(ssms_dir, 'bf_oms.mztab'))\n",
    "ssms_oms_shifted = reader.read_mztab_ssms(os.path.join(\n",
    "    ssms_dir, 'bf_oms_shifted.mztab'))\n",
    "ssms_oms_nocascade = reader.read_mztab_ssms(os.path.join(\n",
    "    ssms_dir, 'bf_oms_nocascade.mztab'))\n",
    "ssms_oms_nocascade_shifted = reader.read_mztab_ssms(os.path.join(\n",
    "    ssms_dir, 'bf_oms_nocascade_shifted.mztab'))\n",
    "\n",
    "num_ssms = pd.DataFrame(\n",
    "    {'search mode': ['20 ppm', '300 Da (cascade, dot)',\n",
    "                     '300 Da (cascade, shifted dot)',\n",
    "                     '300 Da (no cascade, dot)',\n",
    "                     '300 Da (no cascade, shifted dot)'],\n",
    "    'number of SSMs': [len(ssms_std), len(ssms_oms), len(ssms_oms_shifted),\n",
    "                       len(ssms_oms_nocascade), len(ssms_oms_nocascade_shifted)]})\n",
    "\n",
    "num_ssms"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
